package com.gopay.common.domain.cbrmb.internationalcard;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * 跨境人民币 外卡支付辅助表
 * @CbRmbWildCardAssistDtl.java
 * @author lailingyu
 * @2017-10-26 下午5:34:53  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name="CB_RMB_WILD_CARD_ASSIST_DTL")
public class CbRmbWildCardAssistDtl extends BaseEntity {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 7869492629685635334L;

	private Long cbRmbWildCardSq;

	private String gopayOrderId;

	private String upperOrderId;

	private BigDecimal wildCardTranAmt;

	private String wildCardTranCur;

	private BigDecimal wildCardTranRate;

	private Date wildCardPayFinishTime;

	private BigDecimal quotaAmt;

	private Date wildCardSettleTime;

	private BigDecimal wildCardHaveDepositAmt;

	private BigDecimal upperSettleAmt;

	private BigDecimal upperFeeAmt;

	private BigDecimal upperDepositAmt;

	private Date createTime;

	private int version;

	private String remark1;

	private String wildCardPayStatus;

	private Date updateTime;

	private BigDecimal wildCardInitDepositAmt;

	private BigDecimal refundedQuotaAmt;

	private String settleFlag;

	/**
     * 对账次数
     */
    private int checkCount=0;

	/**
	 * 外卡支付的银行卡号
	 */
    private String cardNo;

    /**
     * 外卡支付的持卡人姓名
     */
    private String cardUserName;

	/**
	 * 持卡人名
	 */
    private String cardHolderFname;

	/**
	 * 持卡人姓
	 */
	private String cardHolderLname;

	/**
	 * 外卡付款机构代码
	 */
	private String orgCode;

	/**
	 * 外币累计退款金额
	 */
	private BigDecimal totalRefundAmt;

	/**
	 * 外币退款已用金额
	 */
	private BigDecimal refundUsedLimit;

	/**
	 * 外卡退款状态
	 */
	private String refundStatus;

	/**
	* 实际验证方式（10-3D;11-非3D）
	*/
	private String actualCheckWay;

	/**
	 * Enrolment Check接口返回的乾汇订单号
	 */
	private String enrolmentOrderNo;
	/**
	 * Validate Authentication接口返回的乾汇订单号
	 */
	private String validationOrderNo;

	/**
	 * SQ
	 * @return
	 */
	@Id
    @SequenceGenerator(name = "sq", sequenceName = "CB_RMB_WILD_CARD_ASS_SEQ")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sq")
    @Column(name = "CB_RMB_WILD_CARD_SQ", unique = true, nullable = false)
	public Long getCbRmbWildCardSq() {
		return cbRmbWildCardSq;
	}

	public void setCbRmbWildCardSq(Long cbRmbWildCardSq) {
		this.cbRmbWildCardSq = cbRmbWildCardSq;
	}

	/**
	 * 国付宝订单号
	 * @return
	 */
	@Column(name = "GOPAY_ORDER_ID", nullable = false, length = 30)
	public String getGopayOrderId() {
		return gopayOrderId;
	}

	public void setGopayOrderId(String gopayOrderId) {
		this.gopayOrderId = gopayOrderId;
	}

	/**
	 * 乾汇订单号
	 * @return
	 */
	@Column(name = "UPPER_ORDER_ID", length = 30)
	public String getUpperOrderId() {
		return upperOrderId;
	}

	public void setUpperOrderId(String upperOrderId) {
		this.upperOrderId = upperOrderId;
	}

	/**
	 * 外卡支付的金额
	 * @return
	 */
	@Column(name = "WILD_CARD_TRAN_AMT", precision = 20)
	public BigDecimal getWildCardTranAmt() {
		return wildCardTranAmt;
	}

	public void setWildCardTranAmt(BigDecimal wildCardTranAmt) {
		this.wildCardTranAmt = wildCardTranAmt;
	}

	/**
	 * 外卡支付的币种
	 * @return
	 */
	@Column(name = "WILD_CARD_TRAN_CUR", length = 10)
	public String getWildCardTranCur() {
		return wildCardTranCur;
	}

	public void setWildCardTranCur(String wildCardTranCur) {
		this.wildCardTranCur = wildCardTranCur;
	}

	/**
	 * 支付的汇率
	 * @return
	 */
	@Column(name = "WILD_CARD_TRAN_RATE", precision = 20)
	public BigDecimal getWildCardTranRate() {
		return wildCardTranRate;
	}

	public void setWildCardTranRate(BigDecimal wildCardTranRate) {
		this.wildCardTranRate = wildCardTranRate;
	}

	/**
	 * 支付完成时间
	 * @return
	 */
	@Column(name = "WILD_CARD_PAY_FINISH_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getWildCardPayFinishTime() {
		return wildCardPayFinishTime;
	}

	public void setWildCardPayFinishTime(Date wildCardPayFinishTime) {
		this.wildCardPayFinishTime = wildCardPayFinishTime;
	}

	/**
	 * 定额手续费
	 * @return
	 */
	@Column(name = "QUOTA_AMT", precision = 20)
	public BigDecimal getQuotaAmt() {
		return quotaAmt;
	}

	public void setQuotaAmt(BigDecimal quotaAmt) {
		this.quotaAmt = quotaAmt;
	}

	/**
	 * 支付清算时间
	 * @return
	 */
	@Column(name = "WILD_CARD_SETTLE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getWildCardSettleTime() {
		return wildCardSettleTime;
	}

	public void setWildCardSettleTime(Date wildCardSettleTime) {
		this.wildCardSettleTime = wildCardSettleTime;
	}

	/**
	 * 可退保证金
	 * @return
	 */
	@Column(name = "WILD_CARD_HAVE_DEPOSIT_AMT", precision = 20)
	public BigDecimal getWildCardHaveDepositAmt() {
		return wildCardHaveDepositAmt;
	}

	public void setWildCardHaveDepositAmt(BigDecimal wildCardHaveDepositAmt) {
		this.wildCardHaveDepositAmt = wildCardHaveDepositAmt;
	}

	/**
	 * 上游清算金额
	 * @return
	 */
	@Column(name = "UPPER_SETTLE_AMT", precision = 20)
	public BigDecimal getUpperSettleAmt() {
		return upperSettleAmt;
	}

	public void setUpperSettleAmt(BigDecimal upperSettleAmt) {
		this.upperSettleAmt = upperSettleAmt;
	}

	/**
	 * 上游手续费
	 * @return
	 */
	@Column(name = "UPPER_FEE_AMT", precision = 20)
	public BigDecimal getUpperFeeAmt() {
		return upperFeeAmt;
	}

	public void setUpperFeeAmt(BigDecimal upperFeeAmt) {
		this.upperFeeAmt = upperFeeAmt;
	}

	/**
	 * 上游保证金
	 * @return
	 */
	@Column(name = "UPPER_DEPOSIT_AMT", precision = 20)
	public BigDecimal getUpperDepositAmt() {
		return upperDepositAmt;
	}

	public void setUpperDepositAmt(BigDecimal upperDepositAmt) {
		this.upperDepositAmt = upperDepositAmt;
	}

	/**
	 * 创建时间
	 * @return
	 */
	@Column(name = "CREATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * 版本号
	 * @return
	 */
	@Version
	@Column(name="VERSION", nullable = false, precision = 22, scale = 0)
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	/**
	 * 备注
	 * @return
	 */
	@Column(name = "REMARK1", length = 100)
	public String getRemark1() {
		return remark1;
	}

	public void setRemark1(String remark1) {
		this.remark1 = remark1;
	}

	/**
	 * 支付状态
	 * @return
	 */
	@Column(name = "WILD_CARD_PAY_STATUS", length = 100)
	public String getWildCardPayStatus() {
		return wildCardPayStatus;
	}

	public void setWildCardPayStatus(String wildCardPayStatus) {
		this.wildCardPayStatus = wildCardPayStatus;
	}

	/**
	 * 更新时间
	 * @return
	 */
	@Column(name = "UPDATE_TIME")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * 初始保证金
	 * @return
	 */
	@Column(name = "WILD_CARD_INIT_DEPOSIT_AMT", precision = 20)
	public BigDecimal getWildCardInitDepositAmt() {
		return wildCardInitDepositAmt;
	}

	public void setWildCardInitDepositAmt(BigDecimal wildCardInitDepositAmt) {
		this.wildCardInitDepositAmt = wildCardInitDepositAmt;
	}

	/**
	 * 已退款定额手续费
	 * @return
	 */
	@Column(name = "REFUNDED_QUOTA_AMT", precision = 20)
	public BigDecimal getRefundedQuotaAmt() {
		return refundedQuotaAmt;
	}

	public void setRefundedQuotaAmt(BigDecimal refundedQuotaAmt) {
		this.refundedQuotaAmt = refundedQuotaAmt;
	}

	/**
	 * 对账次数
	 * 
	 * @Description:  
	 * @return 
	 */
	@Column(name = "CHECK_COUNT")
	public int getCheckCount() {
		return checkCount;
	}

	public void setCheckCount(int checkCount) {
		this.checkCount = checkCount;
	}

	/**
	 * 是否已清算：0-否；1-是
	 * @return
	 */
	@Column(name = "SETTLE_FLAG",length = 1)
	public String getSettleFlag() {
		return settleFlag;
	}

	public void setSettleFlag(String settleFlag) {
		this.settleFlag = settleFlag;
	}


	@Column(name = "CARD_NO", length = 150)
	public String getCardNo() {

		this.cardNo = SensitiveInfoUtils.autoReencrypt(this.cardNo);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.cardNo);
	}

	public void setCardNo(String cardNo) {

		this.cardNo = SensitiveInfoUtils.smartEncryptWithCheck(cardNo);
	}
	
	@Column(name = "CARD_USER_NAME", length = 150)
	public String getCardUserName() {
		return cardUserName;
	}

	public void setCardUserName(String cardUserName) {
		this.cardUserName = cardUserName;
	}

	@Column(name = "CARD_HOLDER_FNAME", length = 100)
	public String getCardHolderFname() {
		return cardHolderFname;
	}

	public void setCardHolderFname(String cardHolderFname) {
		this.cardHolderFname = cardHolderFname;
	}

	@Column(name = "CARD_HOLDER_LNAME", length = 100)
	public String getCardHolderLname() {
		return cardHolderLname;
	}

	public void setCardHolderLname(String cardHolderLname) {
		this.cardHolderLname = cardHolderLname;
	}

	@Column(name = "ORG_CODE", length = 30)
	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	@Column(name = "TOTAL_REFUND_AMT", precision = 20)
	public BigDecimal getTotalRefundAmt() {
		return totalRefundAmt;
	}

	public void setTotalRefundAmt(BigDecimal totalRefundAmt) {
		this.totalRefundAmt = totalRefundAmt;
	}

	@Column(name = "REFUND_USED_LIMIT", precision = 20)
	public BigDecimal getRefundUsedLimit() {
		return refundUsedLimit;
	}

	public void setRefundUsedLimit(BigDecimal refundUsedLimit) {
		this.refundUsedLimit = refundUsedLimit;
	}

	@Column(name = "REFUND_STATUS", length = 2)
	public String getRefundStatus() {
		return refundStatus;
	}

	public void setRefundStatus(String refundStatus) {
		this.refundStatus = refundStatus;
	}

	@Column(name = "ACTUAL_CHECK_WAY", length = 2)
	public String getActualCheckWay() {
		return actualCheckWay;
	}

	public void setActualCheckWay(String actualCheckWay) {
		this.actualCheckWay = actualCheckWay;
	}

	@Column(name = "ENROLMENT_ORDER_NO", length = 20)
	public String getEnrolmentOrderNo() {
		return enrolmentOrderNo;
	}

	public void setEnrolmentOrderNo(String enrolmentOrderNo) {
		this.enrolmentOrderNo = enrolmentOrderNo;
	}
	@Column(name = "VALIDATION_ORDER_NO", length = 20)
	public String getValidationOrderNo() {
		return validationOrderNo;
	}

	public void setValidationOrderNo(String validationOrderNo) {
		this.validationOrderNo = validationOrderNo;
	}
}
